﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class MyButton : MonoBehaviour, IPointerClickHandler ,IPointerUpHandler ,IPointerDownHandler
{
    public AudioClip _audioClip;

    public Action<PointerEventData> onClickAction;

    public Action<PointerEventData> onUpAction;

    public Action<PointerEventData> onDownAction;
    public void OnPointerClick(PointerEventData eventData)
    {
        if (onClickAction != null)
        {
            onClickAction.Invoke(eventData);
        }
    }

    public void OnPointerDown(PointerEventData eventData)
    {
        if (onDownAction != null)
        {
            onDownAction.Invoke(eventData);
        }
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        if (onUpAction != null)
        {
            onUpAction.Invoke(eventData);
        }
    }

    
}
